<!-- 工序管理 -->
<template>
  <div class="page-box h100 display-flex czbj">
    <div class="n-card-header__main pm10">
      工序管理
    </div>
    <div>
      <dxtable :headBtn="headBtn" :dataJson="dataJson" :portUrl="portUrl" :qx="qx" ref="databale" :formJson="formJson">
      </dxtable>
    </div>
  </div>
</template>
<script lang='ts' setup>
import dxtable from "../../components/util/dxtable.vue";
import sort from "../../components/util/sort.vue";
import { dxget, dxpost, qurl, hf } from "../../util/index";
import { h, ref, reactive } from "vue";
const props = defineProps({
  pup: { type: String },
});

let headBtn = [];
const zdList = ref()
const databale = ref();
const initeer = () => {
  databale.value.initDataExpose();
};
const emit = defineEmits(["callBack"]);
// 弹窗公用该列表
let dataJson = reactive([

  {
    title: "工序ID",
    width: 80,
    key: "id",
  },
  {
    title: "工序代码",
    search: true, // 是否在搜索栏展示
    key: "process",
  },
  {
    title: "工序名称",
    search: true, // 是否在搜索栏展示
    key: "process_desc",
  }, {
    title: "是否委外",
    search: true, // 是否在搜索栏展示
    type: "select",
    options: [{
      label: "全部", 
      value: ""
    }, {
      label: "是",
      value: 1
    }, {
      label: "否",
      value: 0
    }],
    key: "is_out",
    render(row) {
      return row.is_out == 0 ? '否' : "是"
    }
  },  {
    title: "排序",
    width: 100,
    render(row) {
      row.databaseName = "dic_processes";
      row.tb="mysql2"
      return h(sort, {
        row,
        onCallBack: () => {
          initeer();
        },
      });
    },
  },
]);
let portUrl = "hhscdd/dic_processes";
const qx = {
  DeletePermissionID: "hhroledel", //删除
  EditPermissionIdentifier: "hhrolebj", // 编辑
  NewPermissionIdentifier: "hhrolexz", // 新建
  ViewPermissionID: "hhroleck", // 查看
};
let formJson = reactive([{
  title: "工序代码",
  key: "process",
  type: "input",
  required: true,

},
{
  title: "工序名称",
  key: "process_desc",
  type: "input",
  required: true,
  span: "24"
}, {
  title: "是否委外",
  key: "is_out",
  type: "radio",
  required: true,
  val: 0,
  opt: [
    {
      label: "是",
      value: 1
    },
    {
      label: "否",
      value: 0
    }
  ]
},
])

</script>
  
  